package com.example.samsungproject;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        TabHost tabHost = getTabHost();
 
        // Tab for Contact
        TabSpec contactspec = tabHost.newTabSpec("Contact");
        // setting Title and Icon for the Tab
        contactspec.setIndicator("Contact", getResources().getDrawable(R.drawable.icon_contact_tab));
        Intent contactIntent = new Intent(this, ContactActivity.class);
        contactspec.setContent(contactIntent);
 
        // Tab for SMS
        TabSpec smsspec = tabHost.newTabSpec("SMS");
        smsspec.setIndicator("SMS", getResources().getDrawable(R.drawable.icon_sms_tab));
        Intent songsIntent = new Intent(this, SmsActivity.class);
        smsspec.setContent(songsIntent);
 
        // Tab for Search
        TabSpec searchspec = tabHost.newTabSpec("Search");
        searchspec.setIndicator("Search", getResources().getDrawable(R.drawable.icon_search_tab));
        Intent searchIntent = new Intent(this, SearchActivity.class);
        searchspec.setContent(searchIntent);
 
        // Adding all TabSpec to TabHost
        tabHost.addTab(contactspec); // Adding photos tab
        tabHost.addTab(smsspec); // Adding songs tab
        tabHost.addTab(searchspec); // Adding videos tab
    }
}
